﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;

namespace ViCode_LeVi.Reports
{
    public partial class frmViewReport : Form
    {
        public frmViewReport(DevExpress.XtraReports.UI.XtraReport _Report, object _ReportDatasource)
        {
            InitializeComponent();
            ReportDataSource = _ReportDatasource;
            Report = _Report;
        }
        private object _ReportDataSource;

        public object ReportDataSource
        {
            get { return _ReportDataSource; }
            set { _ReportDataSource = value; }
        }
        DevExpress.XtraReports.UI.XtraReport Report;
        private void InitReport()
        {
            //Report_BalancedScoreCards rep = new Report_BalancedScoreCards();
            //var rep = new XtraReport();
            //rep.LoadLayout(@"C:\123.repx");
            //rep.PrintingSystem.ClearContent();
            //rep.DataSource = null;
            //rep.Name = "adsad";
            Report.DataSource = ReportDataSource;
            //rep.PrintingSystem.Document.Name = "VMTabBalanceAndOthers_Balance";
            Report.CreateDocument();
            printControl1.PrintingSystem = Report.PrintingSystem;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            InitReport();
        }
    }
}
